Skip to content

chore(dev): add a safe upstream sync workflow - #80

Open
bbnotcode wants to merge 3 commits into
ericjypark:mainfrom
bbnotcode:codex/local-source-sync
Open

chore(dev): add a safe upstream sync workflow#80
bbnotcode wants to merge 3 commits into
ericjypark:mainfrom
bbnotcode:codex/local-source-sync

Conversation

@bbnotcode

Copy link
Copy Markdown
Contributor

Summary

  • Add a source-sync script that fetches upstream, creates a backup branch, merges without auto-committing, validates the result, and supports abort.
  • Add a double-clickable macOS command launcher for users who do not want to run Terminal commands manually.
  • Mark local source builds so Sparkle cannot replace custom features with an official binary after restart.
  • Keep Sparkle enabled for release builds through ENABLE_UPDATES=1.
  • Add an English and Chinese guide in docs/UPSTREAM_SYNC.md.

Why

People who maintain local custom features need to pull upstream releases without losing their work. Binary auto-update and source-level customization are different update paths; this makes that distinction explicit and recoverable.

中文说明

  • 增加安全同步脚本:拉取上游、创建备份分支、执行不自动提交的合并、验证结果,并支持一键中止。
  • 增加可双击执行的 macOS command 文件,方便不使用终端的用户。
  • 本地源码构建会关闭官方 Sparkle 更新,避免重启后官方二进制覆盖本地功能。
  • 正式 release 构建仍通过 ENABLE_UPDATES=1 启用 Sparkle。
  • docs/UPSTREAM_SYNC.md 提供完整中英文操作与恢复说明。

Validation

  • ./build.sh
  • ./scripts/run-tests.sh
  • git diff --check

All checks passed on macOS.

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@bbnotcode, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 45 minutes

Limit details: You’ve used all 2 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c5c7514c-e38a-4cc4-aa95-6a8676e75d4c

📥 Commits

Reviewing files that changed from the base of the PR and between 0931117 and 8efbb8a.

📒 Files selected for processing (9)
  • Resources/en.lproj/Localizable.strings
  • Resources/zh-Hans.lproj/Localizable.strings
  • Sources/Update/UpdaterController.swift
  • Sources/Views/SettingsView.swift
  • build.sh
  • docs/UPSTREAM_SYNC.md
  • release.sh
  • scripts/sync-upstream.sh
  • 同步上游并构建.command

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8efbb8a718

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/sync-upstream.sh
exit 1
fi

if ! run_validation; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve validation failures before committing

When a clean merge causes run-tests.sh to fail, invoking run_validation as the condition of if ! disables Bash's set -e behavior throughout the function. The function then reaches the false SYNC_BUILD_APP check, returns success, and the script commits the unvalidated merge and reports success. Capture the function's status explicitly or make each validation command return immediately on failure.

Useful? React with 👍 / 👎.

Comment thread scripts/sync-upstream.sh
Comment on lines +78 to +79
run_validation
git commit --no-edit

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject unstaged fixes before validating the merge

If a user stages a conflict resolution and then adjusts it again—especially after a validation failure—run_validation tests the newer working-tree contents, but git commit --no-edit records the older index contents and still reports success. As confirmed by git commit -h, -a/--all is the option to “commit all changed files”; this call neither uses it nor verifies that the working tree matches the index, so the resulting merge can differ from what passed validation.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant